#ifndef _PROCESS_H
#define _PROCESS_H
#include <stdint.h>
#include <stddef.h>
#include "config.h"
#include "keyboard/keyboard.h"

struct process
{   
    // PID
    uint16_t id; 

    // File name
    char filename[TESTOS_MAX_PATH_SIZE]; 

    // The main process task
    struct task* task; 

    // Mamory allocations by malloc (not kmalloc)
    void* allocations[TESTOS_MAX_PROCESS_ALLOCATIONS];

    // Psysical pointer to the memory of the process
    void* ptr;

    // Psysical pointer to the stack memory
    void* stack; 

    // The size of the data pointed to the "ptr"
    uint32_t size; 

    struct keyboard_buffer
    {
        char buffer[TESTOS_KEYBOARD_BUFFER_SIZE];
        int head; 
        int tail; 
    }
    keyboard; 
}
__attribute__((packed)); 

struct process* get_current_process(); 
const int process_load(const char* filename, struct process** process);
const int process_load_for_slot(const char* filename, struct process** process, const int process_slot); 

#endif
